<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script src="./axios.min.js"></script>
<script>
    //基本使用
    //1.地方,方法,入参,回参
    // axios({
    //     url:'http://localhost:3000/fanji/?pageSize=10&page=1',
    //     method:'GET',
    //     headers:{
    //         'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0aW1lIjoxNzM5MzQzMzgzNTY1LCJleHBpcmUiOjg2NDAwMDAwLCJpYXQiOjE3MzkzNDMzODN9.3gBy0EGlfLIVbLyCTHDAkaJXtnpjv12rlj6jnYzOv3c'
    //     }
    // }).then(result=>{
    //     console.log(result);
    // })
    // //2.使用get子方法
    let url='http://localhost:3000/fanji?pages=Size=10&page=1'
    axios.get(url,
        {//配置对象
            headers:{
                'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0aW1lIjoxNzQwNDU0NDE2MTMwLCJleHBpcmUiOjg2NDAwMDAwLCJpYXQiOjE3NDA0NTQ0MTZ9.uhJNKeShgbEY-nv9ucoNEkswEpsQ6Y2-ZaPMDsPYCl0'
            },
            params:{//get带参
                pageSize:2,
                page:1
            }
        }
    ).then(result=>{
        console.log(result);
    })
    // //post
    axios.post(url,
    {//数据包
        list:[]
    },
        {//配置对象
            headers:{
                'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0aW1lIjoxNzQwNDU0NDE2MTMwLCJleHBpcmUiOjg2NDAwMDAwLCJpYXQiOjE3NDA0NTQ0MTZ9.uhJNKeShgbEY-nv9ucoNEkswEpsQ6Y2-ZaPMDsPYCl0'
            }
        }
    ).then(result=>{
        console.log(result);
    })
</script>
</html>